package top.myliangsl.newsapplets.job;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import top.myliangsl.newsapplets.service.jdApi.JdApiService;

import javax.annotation.Resource;

/**
 * 定时调用京东API的job
 *
 * @author xiaoliang
 */
@Component
@Slf4j
public class JdApiJob {
    @Resource
    private JdApiService jdApiService;

    @Scheduled(cron = "0 0/15 * * * ?")
    public void startJobToGetNewsChannel() {
        log.info("---------触发定时任务：定时去采集万象API的数据----------");
        jdApiService.operateNews();
    }

}
